using System;
using System.Collections.Generic;
using System.Text;
using Menfram.Entity.Interface;
using Menfram.DAL.Reflection;


namespace Entity
{

    [Table(TableName = "sys.objects", SequenceName = "id", KeyName = "id", ClassName = "Entity.ColumnEntity")] 
    public class ColumnEntity:IEntity
    {
        private int PTamanho;

        [Field(FieldName = "length")]
        public int Tamanho
        {
            get { return PTamanho; }
            set { PTamanho = value; }
        }

        private bool? PIsNullable;

        [Field(FieldName = "isnullable")]
        public bool? IsNullable
        {
            get { return PIsNullable; }
            set { PIsNullable = value; }
        }

        private bool? PIsChave;

        public bool? IsChave
        {
            get { return PIsChave; }
            set { PIsChave = value; }
        }

        #region IEntidade Members

        private int? PSequencial;
        public int? Sequencial
        {
            get
            {
                return PSequencial;
            }
            set
            {
                PSequencial = value;
            }
        }

        public string Chave
        {
            get { return PSequencial.ToString(); }
        }

        public string DescricaoCombo
        {
            get { return PSequencial.ToString(); }
        }

        #endregion

        private String PNomeColuna;

        [Field(FieldName = "column_name")]
        public String NomeColuna
        {
            get { return PNomeColuna; }
            set { PNomeColuna = value; }
        }

        private String PTipoColuna;

        [Field(FieldName = "data_type")]
        public String TipoColuna
        {
            get { return PTipoColuna; }
            set { PTipoColuna = value; }
        }
        public override string ToString()
        {
            return NomeColuna;
        }


        #region IEntity Members


        public string Key
        {
            get { throw new NotImplementedException(); }
        }

        public string DescriptionComboBox
        {
            get { throw new NotImplementedException(); }
        }

        #endregion
    }
}
